<template>
	<view class="page flex flex-col">
		<navbar :leftText="'设备详情'" :backStatus="true" :borderStatus="true"></navbar>
		<view class="flex-1 text-white">
			<!-- <view class="deviceJieBg w690 ">
				<view class="text-28 deviceName flex-start">
					<text style="margin-right: 20rpx;">t-陕西西安-34934-antd47</text>
					<view class="flex-start">
						<view class="onlineIcon"></view>
						<view class="text-green">在线</view>
					</view>
					<view class="flex-start">
						<view class="offlineIcon"></view>
						<view class="text-red">离线</view>
					</view>
				</view>
				<view class="text-28 flex-between" style="margin-top: 20rpx;">
					<view class="text-blue">节点ID</view>
					<view class="flex-start">antd47b41f009dda8570
						<up-copy content="192.168.2.2">
							<image class="copyIcon"
								src="http://yyx-web-oss.oss-cn-beijing.aliyuncs.com/shopping/copy.png" mode="">
							</image>
						</up-copy>
					</view>
				</view>
				<view class="text-28 flex-between" style="margin-top: 20rpx;">
					<view class="text-blue">绑定时间</view>
					<view>2024/08/24 17:43</view>
				</view>
				<view class="text-28 flex-between" style="margin-top: 20rpx;">
					<view class="text-blue">累积结算收益</view>
					<view>￥0.00</view>
				</view>
				<view class="text-28 flex-between" style="margin-top: 20rpx;">
					<view class="text-blue">节点累积待结算收益</view>
					<view>￥0.00</view>
				</view>
				<view class="text-28 flex-between" style="margin-top: 20rpx;">
					<view class="text-blue">跨省调度</view>
					<view class="flex-start">支持跨省，调度比例 100%
					</view>
				</view>
				<view class="text-28 flex-between" style="margin-top: 20rpx;">
					<view class="text-blue">节点备注</view>
					<view class="flex-start">公司测试
					</view>
				</view>
				<view class="text-28 flex-between">
					<view class="text-blue">操作</view>
					<view class="flex-start">
						<view @click="resertSubmit" style="color:#04FFFF;margin-right:20rpx;">重新提交</view>
						<view @click="returnTui" style="color:#F02947;margin-right:20rpx;">清退</view>
						<view @click="yaCeShowBox" style="color:#04FFFF;margin-right:20rpx;">压测</view>
						<view @click="resertDevice" style="color:#04FFFF;">重启</view>
					</view>
				</view>
			</view> -->

			<!-- 设备信息分类介绍 -->
			<view style="background-color:#11102A;">
				<view class="w690" style="padding-bottom: 20rpx;">
					<view>
						<up-tabs :list="deviceList" @click="deviceSelect" lineWidth="40" lineColor="#38FDFF"
							:activeStyle="{
				    color: '#38FDFF',
				    fontWeight: 'bold'
				}" :inactiveStyle="{
				    color: '#FFFFFF ',
				    transform: 'scale(1)'
				}" itemStyle="padding-left: 10px; padding-right: 10px; height: 50px;"></up-tabs>
						<view class="classify"></view>
					</view>
					<!-- 收益 -->
					<view v-if="deviceIndex == 0">
						<!-- shouYiData -->
						<shouYi :shouYiData="shouYiData"></shouYi>
					</view>
					<!-- 宽带 -->
					<view v-if="deviceIndex == 1">
						<kuandai :nodeId="nodeId"></kuandai>
					</view>
					<!-- 异常信息 -->
					<!-- <view v-if="deviceIndex == 2">
						<abnormalInfo :yiChangData="yiChangData"></abnormalInfo>
					</view> -->
					<!-- 网络信息 -->
					<view v-if="deviceIndex == 2">
						<view class="text-28 flex-between" style="margin-top: 20rpx;">
							<view class="text-blue">设备 MAC</view>
							<view class="flex-start">
								{{networkObj.convergeDetailVOS[0].convergeStatusInfo[0].mac || '--'}}
								<up-copy content="uview-plus is great !">
									<image class="copyIcon"
										src="http://yyx-web-oss.oss-cn-beijing.aliyuncs.com/shopping/copy.png" mode="">
									</image>
								</up-copy>

							</view>
						</view>
						<!-- <view class="text-28 flex-between" style="margin-top: 20rpx;">
							<view class="text-blue">检测时间</view>
							<view class="flex-start">2024/08/24 17:43
							</view>
						</view> -->
						<view class="text-28 flex-between" style="margin-top: 20rpx;">
							<view class="text-blue">IP</view>
							<view class="flex-start">
								<view>
									<view class="flex-end">{{networkObj.ipv4 || '--'}}
										<up-copy content="uview-plus is great !">
											<image class="copyIcon"
												src="http://yyx-web-oss.oss-cn-beijing.aliyuncs.com/shopping/copy.png"
												mode="">
											</image>
										</up-copy>
									</view>
									<view class="flex-end">
										{{networkObj.ipv6 || '--'}}
										<up-copy content="uview-plus is great !">
											<image class="copyIcon"
												src="http://yyx-web-oss.oss-cn-beijing.aliyuncs.com/shopping/copy.png"
												mode="">
											</image>
										</up-copy>
									</view>
								</view>
							</view>
						</view>
						<view class="text-28 flex-between" style="margin-top: 20rpx;">
							<view class="text-blue">运营商</view>
							<view class="flex-start">{{networkObj.isp || '--'}}</view>
						</view>
						<view class="text-28 flex-between" style="margin-top: 20rpx;">
							<view class="text-blue">省市</view>
							<view class="flex-start">{{networkObj.province || '--'}}{{networkObj.city || '--'}}</view>
						</view>
						<view class="text-28 flex-between" style="margin-top: 20rpx;">
							<view class="text-blue">拨号类型</view>
							<view class="flex-start">
								<text v-if="networkObj.dialType == 'staticNetSingle'">固定公网单 IP</text>
								<text v-if="networkObj.dialType == 'staticNetCouple'">固定公网多 IP</text>
								<text v-if="networkObj.dialType == 'serverDial'">服务器拨号</text>
								<text v-if="networkObj.dialType == 'dhcpNetSingle'">DHCP单 IP</text>
								<text v-if="networkObj.dialType == 'dhcpNetCouple'">DHCP多 IP</text>
								<text v-if="networkObj.dialType == 'virtualRoute'">软路由</text>
								<!-- 单拨 -->
								<!-- <image @click="selectDanBo" class="copyIcon"
									src="http://yyx-web-oss.oss-cn-beijing.aliyuncs.com/shopping/edit.png" mode="">
								</image> -->
							</view>
						</view>
						<view class="text-28 flex-between" style="margin-top: 20rpx;">
							<view class="text-blue">拨号方式</view>
							<view class="flex-start">
								{{networkObj.interfaceVOS[0].subNetPortInfoVOS[0].dynamic ? '动态' : '静态'}}
								IP
							</view>
						</view>
						<!-- <view class="text-28 flex-between" style="margin-top: 20rpx;">
							<view class="text-blue">拨号线路</view>
							<view @click="checkNetwork" class="flex-start text-green-light">{{网络信息}}</view>
						</view> -->
						<view class="text-28 flex-between" style="margin-top: 20rpx;">
							<view class="text-blue">上报带宽</view>
							<view class="flex-start">
								<text
									style="margin-right:10rpx;">{{networkObj.usbw}}Mbps*{{networkObj.bwNum}}={{networkObj.usbw * networkObj.bwNum}}Mbps</text>
								<!-- <text @click="jianSheKuan" class="text-green-light">调整建设带宽</text> -->
							</view>
						</view>
						<view class="text-28 flex-between" style="margin-top: 20rpx;">
							<view class="text-blue">网络类型</view>
							<view class="flex-start">
								<text style="margin-right:10rpx;" v-if="networkObj.natType == 'full'">NAT1</text>
								<text style="margin-right:10rpx;" v-if="networkObj.natType == 'restric'">NAT2</text>
								<text style="margin-right:10rpx;" v-if="networkObj.natType == 'restricPort'">NAT3</text>
								<text style="margin-right:10rpx;" v-if="networkObj.natType == 'symmetric'">NAT4</text>

							</view>
						</view>
						<!-- 	<view class="text-28 flex-between" style="margin-top: 20rpx;">
							<view class="text-blue">NAT(UDP)类型</view>
							<view class="flex-start">NAT1</view>
						</view> -->
						<!-- <view class="text-28 flex-between" style="margin-top: 20rpx;">
							<view class="text-blue">TCP 端口</view>
							<view class="flex-start">- -</view>
						</view> -->
						<!-- <view class="text-28 flex-between" style="margin-top: 20rpx;">
							<view class="text-blue">NAT(TCP)类型</view>
							<view class="flex-start">NAT2</view>
						</view> -->
						<view class="text-28 flex-between" style="margin-top: 20rpx;">
							<view class="text-blue">内网IP</view>
							<view class="flex-start">{{networkObj.interfaceVOS[0].ip || '--'}}
								<up-copy content="192.168.2.2">
									<image class="copyIcon"
										src="http://yyx-web-oss.oss-cn-beijing.aliyuncs.com/shopping/copy.png" mode="">
									</image>
								</up-copy>
							</view>
						</view>
					</view>

					<!-- 质量报告 -->
					<view v-if="deviceIndex == 3">
						<quality :nodeId="nodeId"></quality>
					</view>

					<!-- 硬件信息 -->
					<!-- 	<view v-if="deviceIndex == 5">
						<hardware :nodeId="nodeId"></hardware>
					</view> -->
				</view>


			</view>
		</view>

		<!-- 重启弹窗 -->
		<up-modal :show="deviceStatus" :showCancelButton="true" @confirm="confirmDevice" @cancel="cancelDevice"
			title="提示" content='是否确认重启设备?可能会出现设备无法重启成功的风险' cancelColor="#fff" confirmColor="#0BFFDA"></up-modal>

		<!-- 修改跨省调度 -->
		<up-popup bgColor="#141039" :show="tiaoDuShow" :round="10" mode="bottom" @close="close" @open="open">
			<view>
				<view class="flex-between diaoTitle text-white">
					<view class="text-30">确认修改?</view>
					<up-icon name="close" color="#5A669E" size="20" @click="closeDiao"></up-icon>
				</view>
				<view class="w690 kuaSheng">
					<up-form labelPosition="left" labelWidth="100" :model="model1" :rules="rules" ref="form1">
						<up-form-item label="跨省调度" prop="userInfo.name" ref="item1">
							<up-radio-group v-model="userInfo.diao" placement="row" @change="groupChange">
								<up-radio :customStyle="{marginRight: '30px'}" v-for="(item, index) in kuaOptions"
									:key="index" :label="item.name" :name="item.value" @change="radioChange">
								</up-radio>
							</up-radio-group>
						</up-form-item>
						<up-form-item label="支持跨省比例" prop="userInfo.name" ref="item1">
							<up-input v-model="userInfo.name" placeholder="" suffixIcon="%"
								suffixIconStyle="color: #909399"></up-input>
						</up-form-item>
					</up-form>
					<view class="submit flex-center text-white">保存</view>
				</view>
			</view>
		</up-popup>

		<!-- 修改备注 -->
		<up-popup bgColor="#141039" :show="beiZhuShow" :round="10" mode="bottom" @close="close" @open="open">
			<view>
				<view class="flex-between diaoTitle text-white">
					<view class="text-30">修改备注?</view>
					<up-icon name="close" color="#5A669E" size="20" @click="closeBei"></up-icon>
				</view>
				<view class="w690 kuaSheng">
					<up-form labelPosition="left" labelWidth="0" :model="model1" :rules="rules" ref="form1">
						<up-form-item label="" prop="beiZhuObj.name" ref="item1">
							<up-input v-model="beiZhuObj.name" placeholder="请输入备注"></up-input>
						</up-form-item>
					</up-form>
					<view class="submit flex-center text-white">保存</view>
				</view>
			</view>
		</up-popup>

		<!-- 网络配置方式 -->
		<up-popup bgColor="#141039" :show="networkShow" :round="10" mode="bottom" @close="close" @open="open">
			<view>
				<view class="flex-between diaoTitle text-white">
					<view class="text-30">修改网络配置方式?</view>
					<up-icon name="close" color="#5A669E" size="20" @click="closeNetwork"></up-icon>
				</view>
				<view class="w690 kuaSheng">
					<view class="text-white text-22 peiZhiBg">
						<view>注意:</view>
						<view>1)&nbsp;网络管理方式修改后，将覆盖之前的网络管理数据，请谨
							慎操作</view>
						<view>
							2)&nbsp;服务中节点网络管理方式或拨号类型调整，节点将进入待提交状态
						</view>
					</view>
					<up-form labelPosition="left" labelWidth="100" :model="model1" :rules="rules" ref="form1">
						<up-form-item label="网络配置方式" prop="beiZhuObj.name" ref="item1">
							<up-input v-model="beiZhuObj.name" placeholder="请输入备注"></up-input>
						</up-form-item>
					</up-form>
					<view class="submit flex-center text-white">切换网络配置方式</view>
				</view>
			</view>
		</up-popup>


		<!-- 清退弹窗 -->
		<up-popup bgColor="#141039" :show="returnShow" :round="10" mode="bottom" @close="close" @open="open">
			<view>
				<view class="flex-between diaoTitle text-white">
					<view class="text-30">确认清退?</view>
					<up-icon name="close" color="#5A669E" size="20" @click="closeReturn"></up-icon>
				</view>
				<view class="w690 kuaSheng">
					<view class="text-white text-22 peiZhiBg">
						<view>注意:</view>
						<view>清退后重新上机需要重新扫码绑定请选择清退原因，以便后续更好的服务您</view>
					</view>
					<up-form labelPosition="left" labelWidth="80" :model="model1" :rules="rules" ref="form1">
						<up-form-item label="清退原因" prop="qing.reasons" ref="item1">
							<view class="qingReason" @click="selectQingReason" placeholder="请选择清退原因">
								{{qing.reasonName || '请选择清退原因'}}
							</view>
						</up-form-item>
					</up-form>
					<view @click="confirmReturn" class="submit flex-center text-white text-28">解绑清退</view>
				</view>
			</view>
		</up-popup>


		<!-- 修改建设带宽弹窗 -->
		<up-popup bgColor="#141039" :show="returnYaCe" :round="10" mode="bottom" @close="close" @open="open">
			<view>
				<view class="flex-between diaoTitle text-white">
					<view class="text-30">修改建设带宽</view>
					<up-icon name="close" color="#5A669E" size="20" @click="closeYaCe"></up-icon>
				</view>

				<view v-if="yaListStatus" class="text-white w690 text-28">
					<up-row customStyle="padding: 10px 0;">
						<up-col span="2">
							<view class="flex-center">状态</view>
						</up-col>
						<up-col span="3">
							<view class="flex-center">线路数量</view>
						</up-col>
						<up-col span="4">
							<view class="flex-center">单条上行建设带宽</view>
						</up-col>
						<up-col span="3">
							<view class="flex-center">总建设带宽</view>
						</up-col>
					</up-row>
					<up-row customStyle="padding: 10px 0;">
						<up-col span="2">
							<view class="flex-center">当前</view>
						</up-col>
						<up-col span="3">
							<view class="flex-center">1</view>
						</up-col>
						<up-col span="4">
							<view class="flex-center">55.16 Mbps</view>
						</up-col>
						<up-col span="3">
							<view class="flex-center">55.16 Mbps</view>
						</up-col>
					</up-row>
					<up-row customStyle="padding: 10px 0;">
						<up-col span="2">
							<view class="flex-center">目标</view>
						</up-col>
						<up-col span="3">
							<view class="flex-center">1</view>
						</up-col>
						<up-col span="4">
							<view class="flex-center"> <up-input placeholder="" border="surround" v-model="value"
									@change="change"></up-input> Mbps</view>
						</up-col>
						<up-col span="3">
							<view class="flex-center">55.16 Mbps</view>
						</up-col>
					</up-row>
				</view>
				<view class="w690 kuaSheng">
					<view class="text-white text-22 peiZhiBg">
						<view>温馨提示:</view>
						<view>1.调整后将对带宽重新压测，若不符合要求将调整失败，请留意当前页面的验收结果</view>
						<view>2.服务中节点在 0~11 点、15~17 点 允许调整建设带宽，其他时间禁止调整。</view>
						<view>3.每天压测次数不超过 50 次，当前已使用 1 次。</view>
					</view>
					<view @click="confirmYaCe" class="submit flex-center text-white">压测调整</view>
				</view>
			</view>
		</up-popup>


		<!-- 节点压测  每天压测次数不超过 50 次当前已使用 1 次。-->
		<up-modal :show="yaCeStatus" :showCancelButton="true" @confirm="confirmJieYaCe" @cancel="cancelJieYaCe"
			title="提示" content='请注意，服务中节点在 0~11 点、15~17 点 允许调整建设带宽，其他时间禁止调整; 压测期间不计算业务带宽，无法产生收益!' cancelColor="#fff"
			confirmColor="#0BFFDA"></up-modal>

		<!-- 重新提交 -->
		<up-modal :show="resertStatus" :showCancelButton="true" @confirm="confirmCT" @cancel="cancelCT" title="确定重新提交?"
			content='重新提交后节点将变更为待审核状请确认已按照验收未通过原因中态，的建议对节点信息做了修改' cancelColor="#fff" confirmColor="#0BFFDA"></up-modal>

		<!-- 网络配置方式选项 -->
		<up-picker :show="show" :columns="columns"></up-picker>

		<!-- AI诊断图标 -->
		<!-- <view class="AIBox" @click="checkAiDetail">
			<view class="flex-column-center">
				<image class="jiQiIcon" src="http://yyx-web-oss.oss-cn-beijing.aliyuncs.com/shopping/AI.png" mode="">
				</image>
				<view class="shouYiNo text-22 text-white flex-center">收益不好?</view>
			</view>
		</view> -->

		<up-picker :show="isShowQing" ref="uPickerRef" keyName="name" @cancel="cancelTui" :columns="qingList"
			@confirm="confirmReason" @change="changeHandler"></up-picker>
	</view>
</template>

<script setup>
	import {
		getTimestampAt11AM
	} from "../../../utils/tool.js"
	import {
		onLoad,
		onShow
	} from "@dcloudio/uni-app";


	import * as api from "@/utils/api.js"

	// 组件引入
	// 收益
	import shouYi from "./components/shouYi.vue"
	// 宽带
	import kuandai from "./components/kuandai.vue"
	// 异常信息
	import abnormalInfo from "./components/abnormalInfo.vue"
	// 硬件信息
	import hardware from "./components/hardware.vue"
	// 质量报告
	import quality from "./components/quality.vue"


	import {
		ref,
		reactive,
		onMounted,
		inject
	} from 'vue';

	onLoad((ops) => {
		console.log("ops", ops);
		nodeId.value = ops.nodeId;
	})

	const qing = ref({
		reasons: "",
		reasonName: ""
	})

	const qingList = ref([
		[{
			name: "运营商监管",
			value: "isp"
		}, {
			name: "限电",
			value: "limitElectricity"
		}, {
			name: "带宽质量问题",
			value: "bandwidthQA"
		}, {
			name: "矿主跑量不满意",
			value: "discontentMeasure"
		}, {
			name: "矿主服务不满意",
			value: "discontentService"
		}, {
			name: "域名问题",
			value: "domain"
		}, {
			name: "测试节点",
			value: "testNode"
		}, {
			name: "重装系统导致 ID 变化",
			value: "reinstallSystem"
		}, {
			name: "其他",
			value: "other"
		}]

	])

	// 清退原因弹窗
	const isShowQing = ref(false);

	// 选择清退原因
	const selectQingReason = () => {
		console.log("666666666");
		isShowQing.value = true
	}

	// 清退原因下边
	const qingIndex = ref(0);

	const cancelTui = () => {
		isShowQing.value = false
	}


	// 清退原因发生改变
	const changeHandler = (val) => {
		console.log("val", val);
		qingIndex.value = val.index;
	}
	//确认清退原因
	const confirmReason = () => {
		qing.value.reasonName = qingList.value[0][qingIndex.value].name
		qing.value.reasons = qingList.value[0][qingIndex.value].value
		isShowQing.value = false
	}
	// 节点id
	const nodeId = ref("");

	// 设备分类的下表
	const deviceIndex = ref(0);

	// 选择设备分类
	const deviceSelect = (val) => {
		deviceIndex.value = val.index;
		if (val.index == 2) {
			getNetInfo()
		}
	}

	// 收益列表数据
	const shouYiData = ref();

	// 获取收益信息
	const getShouYi = () => {
		let e = {
			url: "",
			data: {}
		}
		api.default.post(e).then((res) => {
			shouYiData.value = res.data;
		})
	}

	// 宽带数据
	const kuanDaiData = ref();

	// 获取宽带信息
	const getKuanDai = () => {
		let e = {
			url: "",
			data: {}
		}
		api.default.post(e).then((res) => {
			kuanDaiData.value = res.data;
		})
	}


	// 异常列表数据
	const yiChangData = ref();

	// 获取宽带信息
	const getYiChang = () => {
		let e = {
			url: "",
			data: {}
		}
		api.default.post(e).then((res) => {
			yiChangData.value = res.data;
		})
	}

	// 网络信息数据
	const networkData = ref();

	// 获取网络信息
	const getNetwork = () => {
		let e = {
			url: "",
			data: {}
		}
		api.default.post(e).then((res) => {
			networkData.value = res.data;
		})
	}


	// 质量报告数据
	const qualityData = ref();

	// 获取网络信息
	const getQuality = () => {
		let e = {
			url: "",
			data: {}
		}
		api.default.post(e).then((res) => {
			qualityData.value = res.data;
		})
	}


	// 硬件信息数据
	const hardWareData = ref();

	// 获取硬件信息
	const getYingJian = () => {
		let e = {
			url: "",
			data: {}
		}
		api.default.post(e).then((res) => {
			hardWareData.value = res.data;
		})
	}

	const userInfo = reactive({
		diao: 0,
		name: ""
	})

	onMounted(() => {
		isShowjian();

	})

	// 重新提交状态
	const resertStatus = ref(false);

	// 打开重新提交
	const resertSubmit = () => {
		resertStatus.value = true;
	}

	// 确认提交重新提交
	const confirmCT = () => {
		resertStatus.value = false;
	}

	// 取消重新提交
	const cancelCT = () => {
		resertStatus.value = false;
	}

	// 查看网络信息
	const checkNetwork = () => {
		uni.navigateTo({
			url: "/pagesA/device/deviceChild/dialingOnline"
		})
	}

	// 压测弹窗
	const yaCeStatus = ref(false);

	const yaCeShowBox = () => {
		yaCeStatus.value = true;
	}

	// 确认压测
	const confirmJieYaCe = () => {
		let e = {
			url: "/app-api/device/node/networkpressure",
			data: {
				nodeId: nodeId.value ? nodeId.value : 'antd47b41f009dda857030050853fd1d'
			}
		}
		api.default.postXXX(e).then((res) => {
			yaCeStatus.value = false;
			uni.showToast({
				title: "操作成功",
				icon: "none"
			})
		})
	}

	// 取消压测
	const cancelJieYaCe = () => {
		yaCeStatus.value = false;
	}

	// 压测弹窗状态
	const returnYaCe = ref(false);

	// 压测列表状态
	const yaListStatus = ref(false);

	// 调整建设贷款
	const jianSheKuan = () => {
		returnYaCe.value = true;
	}

	// 关闭压测
	const closeYaCe = () => {
		returnYaCe.value = false;
	}

	// 是否展示服务节点列表  根据时间
	const isShowjian = () => {
		console.log("getTimestampAt11AM(0)", getTimestampAt11AM(0));
		// getTimestampAt11AM(0)
		const time0 = getTimestampAt11AM(0)
		const time11 = getTimestampAt11AM(11)
		const time15 = getTimestampAt11AM(15)
		const time17 = getTimestampAt11AM(17)
		// 获取当前时间
		const currentTime = new Date().getTime();
		// 服务中节点在 0~11 点、15~17 点 允许调整建设带宽
		if (currentTime > time0 && currentTime < time11) {
			yaListStatus.value = true
		} else if (currentTime > time15 && currentTime < time17) {
			yaListStatus.value = true
		} else {
			yaListStatus.value = false
		}
	}

	// 压测确认调整
	const confirmYaCe = () => {
		returnYaCe.value = false;
	}

	// 清退弹窗
	const returnShow = ref(false);

	// 关闭清退弹窗
	const closeReturn = () => {
		returnShow.value = false;
		qing.value.reasons = "";
	}

	// 打开清退弹窗
	const returnTui = () => {
		returnShow.value = true;
	}

	// 确定清退
	const confirmReturn = () => {
		if (!qing.value.reasons) {
			uni.showToast({
				title: "请输入清退原因",
				icon: 'none'
			})
			return false
		}
		let e = {
			url: "/app-api/device/node/repel?nodeId=" + (nodeId.value ? nodeId.value :
				'antd47b41f009dda857030050853fd1d'),
			data: {
				reasons: [qing.value.reasons],
				other: qing.value.reasons == 'other' ? 'other reason' : "",
				exceptUtilization: qing.value.reasons == 'discontentMeasure' ? 80 : ''
			}
		}
		api.default.postJson(e).then((res) => {
			qing.value.reasons = "";
			qing.value.reasonName = "";
			returnShow.value = false;
		})
	}

	// 显示单拨
	const selectDanBo = () => {
		networkShow.value = true;
	}

	// 关闭单拨
	const closeNetwork = () => {
		networkShow.value = false;
	}

	// 重启设备状态
	const deviceStatus = ref(false);

	// 打开重启弹窗
	const resertDevice = () => {
		deviceStatus.value = true;
	}

	// 确认重启弹窗
	const confirmDevice = () => {
		deviceStatus.value = false;
	}

	// 取消重启弹窗
	const cancelDevice = () => {
		deviceStatus.value = false;
	}

	// 网络配置方式
	const networkShow = ref(false);

	// 备注对象
	const beiZhuObj = reactive({
		name: ""
	})

	// 设备备注弹窗
	const beiZhuShow = ref(false);

	// 打开设备备注弹窗
	const openBeiZhu = () => {
		beiZhuShow.value = true;
	}

	// 关闭备注弹窗
	const closeBei = () => {
		beiZhuShow.value = false;
	}

	// 调度发生改变
	const groupChange = (val) => {
		console.log("val", val);
	}
	// 调度显示弹窗
	const tiaoDuShow = ref(false);

	// 打开跨省调度
	const openKuaDiao = () => {
		tiaoDuShow.value = true;
	}

	// 关闭调度
	const closeDiao = () => {
		tiaoDuShow.value = false;
	}

	// 跨省调度选项
	const kuaOptions = reactive([{
		name: "支持",
		value: 0
	}, {
		name: "不支持",
		value: 1
	}])

	// 设备信息分类
	const deviceList = reactive([{
			name: '收益'
		},
		{
			name: '带宽'
		},
		// {
		// 	name: '异常信息'
		// },
		{
			name: '网络信息'
		},
		{
			name: '质量报告'
		}
		// ,
		// {
		// 	name: '硬件信息'
		// }
	]);

	// 跳转AI检测
	const checkAiDetail = () => {
		uni.navigateTo({
			url: "/pagesA/device/deviceChild/aiJianCe"
		})
	}

	let networkObj = ref({
		ipv4: "",
		ipv6: "",
		isp: "",
		province: "",
		city: "",
		usbw: "",
		interfaceVOS: [{
			ip: "",
			subNetPortInfoVOS: [{
				dynamic: false
			}]
		}],
		convergeDetailVOS: [{
			convergeStatusInfo: [{}]
		}]
	});
	// 获取网络信息
	const getNetInfo = () => {
		let e = {
			url: "/app-api/device/node/netInfo",
			data: {
				nodeId: nodeId.value ? nodeId.value : 'antd47b41f009dda857030050853fd1d'
			}
		}
		api.default.get(e).then((res) => {
			networkObj.value = res.data;
		})
	}
</script>

<style scoped>
	.page /deep/ .u-line {
		border-top-color: #1E1958 !important;
		border-right-color: #1E1958 !important;
		border-bottom-color: #1E1958 !important;
		height: 100%;
	}

	.page /deep/ .u-modal__button-group__wrapper--cancel {
		border-right: 2rpx solid #1E1958;
		background-color: #141039 !important;
	}

	.page /deep/ .u-modal__button-group__wrapper--confirm {
		background-color: #141039 !important;
	}

	.page /deep/ .u-popup__content {
		/* background-color: #141039 !important; */
		z-index: 99999;
	}

	.page /deep/ .u-modal__title {
		color: #fff;
	}

	.page /deep/ .u-modal__content__text {
		color: #5A669E;
		font-size: 24rpx;
	}

	.onlineIcon {
		width: 14rpx;
		height: 14rpx;
		background-color: #0BFFDA;
		border-radius: 50%;
		margin-right: 5rpx;
	}

	.offlineIcon {
		width: 14rpx;
		height: 14rpx;
		background-color: #d81e06;
		border-radius: 50%;
		margin-right: 5rpx;
	}

	.greenIcon {
		width: 50rpx;
		height: 50rpx;
	}

	.peiZhiBg {
		background-color: rgba(85, 89, 136, 0.2);
		padding: 20rpx;
		box-sizing: border-box;
		margin-top: 20rpx;
		border-radius: 10rpx;
		line-height: 40rpx;
	}

	.submit {
		height: 88rpx;
		background: linear-gradient(90deg, #A102FF 0%, #162CFF 100%);
		border-radius: 44rpx;
		margin: 20rpx 0;
	}


	.kuaSheng /deep/ .u-icon__icon {
		font-size: 28rpx !important;
	}

	.page /deep/ .uni-input-input {
		color: #fff !important;
	}

	.page /deep/ .u-border {
		border-color: rgba(22, 179, 255, 0.25) !important;

	}

	.page /deep/ .u-form-item__body__left__content__label {
		color: #fff !important;
		font-size: 28rpx;
	}

	.diaoTitle {
		padding: 20rpx;
		box-sizing: border-box;
		border-bottom: 2rpx solid #1F1757;
	}

	.classify {
		border-bottom: 2rpx solid #1F1757 !important;
		position: relative;
		top: -8rpx;
	}

	.page /deep/ .u-tabs__wrapper__nav__line {
		z-index: 99;
	}

	.page /deep/ .u-tabs__wrapper__nav__item__text {
		font-size: 28rpx;
	}

	.AIItem {
		padding: 5rpx;
		box-sizing: border-box;
		background-color: #e4393c;
	}

	.deviceName {
		padding: 5rpx 0 20rpx 4rpx;
		box-sizing: border-box;
		border-bottom: 2rpx solid #1F1757;
	}

	.copyIcon {
		width: 28rpx;
		height: 28rpx;
		margin-left: 10rpx;
	}

	.jiQiIcon {
		width: 80rpx;
		height: 80rpx;
	}

	.shouYiNo {
		width: 130rpx;
		padding: 2rpx 5rpx;
		box-sizing: border-box;
		border-radius: 20rpx;
		background: linear-gradient(90deg, #A102FF 0%, #162CFF 100%);
	}

	.AIBox {
		position: fixed;
		right: 0;
		bottom: 100rpx;
	}

	.deviceJieBg {
		/* height: 572rpx; */
		background: url("http://yyx-web-oss.oss-cn-beijing.aliyuncs.com/shopping/jiedian-bg@2x.png") no-repeat;
		background-size: 100% 100%;
		margin-top: 30rpx;
		padding: 14rpx 24rpx;
		box-sizing: border-box;
	}

	.page /deep/ .u-border-bottom {
		border-color: #1F1757 !important;
	}

	.page /deep/ .u-input__content {
		border-color: #fff !important;
	}

	.page /deep/ input {
		color: #fff !important;
		font-size: 28rpx !important;
	}

	.page /deep/ .u-modal__title {
		background-color: #141039 !important;
	}

	.page /deep/ .u-modal__content {
		background-color: #141039 !important;
	}

	.page /deep/ .u-input {
		background-color: #141039 !important;
	}

	.qingReason {
		border: 2rpx solid #1F1757;
		width: 500rpx;
		padding: 20rpx 30rpx;
		box-sizing: border-box;
		color: #fff;
	}
</style>